﻿using LBCMS.EntityFrameWork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace LBCMS.Controllers
{
    public class HomeController : Controller
    {
        [Authorize]
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult test(BLL.PredicateBuilder.queryCondition json)
        {
            return Content(Helper.JsonHelper.toJson(json));
        }

        public ActionResult Main()
        {
            

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult UserList()
        {
            return View();
        }

        public ActionResult MainIndex()
        {
            using (BLLContext db = new BLLContext())
            {
                //获取所有监测点
                ViewBag.Site = Helper.JsonHelper.toJson(db.E_Site.OrderBy(p => p.id).Select(p => new { p.siteName, p.siteNo, p.longAdd, p.latAdd }).ToList());
            }
               

            return View();
        }
    }
}